x86: tighten checks in XEN_DOMCTL_memory_mapping handler
authorJan Beulich <jbeulich@suse.com>
Thu, 20 Sep 2012 07:21:53 +0000 (09:21 +0200)
committerJan Beulich <jbeulich@suse.com>
Thu, 20 Sep 2012 07:21:53 +0000 (09:21 +0200)
commit3616eb8796b44e7df42687a342b9207b26c9e483
tree523b1f9152e3cd9846fb5d0a52b27e928efce0a7
parent051e59b5c4fcb3a41328ff24012d1a99b5912812
x86: tighten checks in XEN_DOMCTL_memory_mapping handler

Properly checking the MFN implies knowing the physical address width
supported by the platform, so to obtain this consistently the
respective code gets moved out of the MTRR subdir.

Btw., the model specific workaround in that code is likely unnecessary
- I believe those CPU models don't support 64-bit mode. But I wasn't
able to formally verify this, so I preferred to retain that code for
now.

But domctl code here also was lacking other error checks (as was,
looking at it again from that angle) the XEN_DOMCTL_ioport_mapping one.
Besides adding the missing checks, printing is also added for the case
where revoking access permissions didn't work (as that may have
implications for the host operator, e.g. wanting to not pass through
affected devices to another guest until the one previously using them
did actually die).

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
xen/arch/x86/cpu/common.c
xen/arch/x86/cpu/intel.c
xen/arch/x86/cpu/mtrr/main.c
xen/arch/x86/domctl.c